#!/usr/bin/perl -w
package clreqd_modules;

use strict;

sub does_file_exist {
my %ARGS=@_;
my $f=$ARGS{FILE};
my $exec=0;

	$exec=$ARGS{EXEC} if exists($ARGS{EXEC});
	if(! -e $f) {
		return "ERROR File '$f' does not exist.";
	}
	if(! -f $f) {
		return "ERROR File system object '$f' exists, but is not a file.";
	}
	if($exec) {
		if(! -x $f) {
			return "ERROR File '$f' exists, but is not executable.";
		}
	}
	return "OK";
}

1;
